<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<!--[if lt IE 9]>
    <script src="jquery-1.9.0.js"></script>
<![endif]-->
		<!--[if gte IE 9]><!-->
		<script src="../js/jquery-3.1.1.js"></script>
		<!--<![endif]-->
		<script type="text/javascript">
			$(document).ready(function() {
				$("p:first-child").css("background-color", "yellow");
			}); //:first-child 选择器选取属于其父元素的第一个子元素。
		</script>
	</head>

	<body>
		<p>The first paragraph in body.</p>

		<div style="border:1px solid;">
			<p>The first paragraph in div.</p>
			<p>The last paragraph in div.</p>
		</div><br>

		<div style="border:1px solid;">
			<span>This is a span element.</span>
			<p>The first paragraph in another div.</p>
			<p>The last paragraph in another div.</p>
		</div>

		<p>The last paragraph in body.</p>

	</body>

</html>